using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.SystemUI;
using ESRI.ArcGIS.Display;

namespace ZJGIS.Framework
{
    [Guid("8c37dbe1-5281-4b99-b7f7-f1927c907677")]
    [ClassInterface(ClassInterfaceType.None)]
    [ProgId("ZJGIS.Framework.AppRefClass")]
    public class AppRefClass : IApplication, AppRef
    {
        private IStatusBar m_StatusBar;
        private ITemplates m_Templates;
        private string m_Name;
        private IApplication m_application;
        private IDocument m_Document;
        private IOperationStack m_OperationStack;
        private IStyleGallery m_StyleGallery;
        public AppRefClass()
        {
        }

        public string Caption { get; set; }

        public ITool CurrentTool { get; set; }//ICommandItem

        public IDocument Document
        {
            get
            {
                return m_Document;
            }
        }
        public IStyleGallery StyleGallery
        {
            get
            {
                return m_StyleGallery;
            }
            set
            {
                m_StyleGallery = value;
            }
        }
        public IOperationStack OperationStack
        {
            get
            {
                return m_OperationStack;
            }
        }

        public virtual int hWnd
        {
            get
            {
                return this.hWnd;
            }
        }

        public virtual string Name
        {
            get
            {
                return m_Name;
            }
        }

        public virtual IStatusBar StatusBar
        {
            get
            {
                return m_StatusBar;
            }
        }

        public virtual ITemplates Templates
        {
            get
            {
                return m_Templates;
            }
        }

        public virtual object VBE
        {
            get
            {
                return null;
            }
        }

        public virtual bool Visible { get; set; }

        public virtual IExtension FindExtensionByCLSID(UID extensionCLSID)
        {
            return null;
        }

        public virtual IExtension FindExtensionByName(string extensionName)
        {
            return null;
        }

        public virtual bool IsDialogVisible(int dialogID)
        {
            return false;
        }

        public virtual void LockCustomization(string Password, ICustomizationFilter custFilter)
        {
        }

        public virtual void NewDocument(bool selectTemplate, string templatePath)
        {
        }

        public virtual void OpenDocument(string path)
        {
        }

        public virtual void PrintDocument()
        {
        }

        public virtual void PrintPreview()
        {
        }

        public virtual void RefreshWindow()
        {
        }

        public virtual void SaveAsDocument(string saveAsPath, bool saveAsCopy)
        {
        }

        public virtual void SaveDocument(string saveAsPath)
        {
        }

        public virtual object ShowDialog(int dialogID, ref object bShow)
        {
            return null;
        }

        public virtual void Shutdown()
        {
            m_application = null;
        }

        public virtual void UnlockCustomization(string Password)
        {
        }

    }
}
